package com.zhoukx.responsibitychain;

public class Client {

    public static void main(String[] args) {
        // 创建一个请求
        PurchaseRequest purchaseRequest = new PurchaseRequest(1, 1000, 1);

        DepartmentApprover departmentApprover = new DepartmentApprover("张主任");
        CollageApprover collageApprover = new CollageApprover("李院长");
        ViceSchoolMasterApprover viceSchoolMasterApprover = new ViceSchoolMasterApprover("王校长");
        SchoolMasterApprover schoolMasterApprover = new SchoolMasterApprover("通校长");


        // 需要将各个审批的下一个人设置好(处理人构成一个环形)
        departmentApprover.setApprover(collageApprover);
        collageApprover.setApprover(viceSchoolMasterApprover);
        viceSchoolMasterApprover.setApprover(schoolMasterApprover);
        schoolMasterApprover.setApprover(departmentApprover);

        departmentApprover.processRequest(purchaseRequest);

    }
}
